<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>reactlesson5</title>

    <script src="../build/react.development.js"></script>
    <script src="../build/react-dom.development.js"></script>
    <script src="../build/babel.min.js"></script>
    <script src="../build/jquery-3.3.1.min.js"></script>
    <!--<script src="https://cdn.bootcss.com/react/15.4.2/react.min.js"></script>
    <script src="https://cdn.bootcss.com/react/15.4.2/react-dom.min.js"></script>
    <script src="https://cdn.bootcss.com/babel-standalone/6.22.1/babel.min.js"></script>-->
</head>
<body>
<div id="example"></div>

<script type="text/babel">
    /**React 的 JSX 使用大、小写的约定来区分本地组件的类和 HTML 标签*/
//    var myDivElement = <div id="mydiv1"></div>
//    ReactDOM.render(myDivElement,document.getElementById("example"));

    class NodeList extends React.Component {
        render() {
            return (
                    <ol>
                        {
                            React.Children.map(this.props.children, function (child) {
                                return <li>{child}</li>;
                            })
                        }
                    </ol>
            );
        }
    }

    ReactDOM.render(
            <NodeList>
                <span>Hello</span>
                <span>world</span>
            </NodeList>,
        document.getElementById("example")
    );
</script>
</body>
</html>